<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户信息详情')" />
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeIn">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <h2>
                       业主信息详情<br/>
                    </h2>
                    <p>
                      </p>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>业主信息</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <input type="hidden" id="ownerId" th:value="${roomrel.ownerId}"/>
                            <button type="button" th:onclick="checkinroom([[${roomrel.ownerId}]])" class="btn btn-primary">入住房屋</button>
                            <button type="button" class="btn btn-info">购买车位</button>
                            <button type="button" class="btn btn-success ">出租车位</button>
                            <button type="button" class="btn btn-primary "><a href="/owner/rel" style="color: white">返回</a></button>
                        </a>
                    </div>
                </div>
                            <div class="ibox-content">
                                <div class="media">
                                    <a class="media-left" href="#">
                                        <img width="120px" height="140px" src="/img/profile.jpg" alt="">
                                    </a>
                                    <div  class="media-body">
                                        <div style="margin-left: 60px;font-size:14px" class="select-list">
                                            <li class="col-md-4" style="margin-bottom: 20px">
                                                业主ID：[[${roomrel.ownerId}]]
                                            </li>
                                            <li class="col-md-4" style="margin-bottom: 20px">
                                                名字：[[${roomrel.name}]]
                                            </li>
                                            <li class="col-md-4" style="margin-bottom: 20px">
                                              性别：[[${@dict.getLabel('sys_user_sex',roomrel.sex)}]]
                                            </li>

                                            <li class="col-md-4" style="margin-bottom: 20px">
                                                身份证：[[${roomrel.numberId}]]
                                            </li>
                                            <li class="col-md-4" style="margin-bottom: 20px">
                                                联系方式：[[${roomrel.phone}]]
                                            </li>
                                            <li class="col-md-4" style="margin-bottom: 20px">
                                                备注：[[${roomrel.remark}]]
                                            </li>
                                        </div>

                                    </div>
                            </div>
                        </div>
            </div>
        </div>
    </div>

    <div class="row"  th:each="room : ${roomList}">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 th:text="${room.roomNum}+'号房屋信息'"></h5>
                </div>
                        <div class="ibox-content">
                            <div class="media">
                                    <div style="margin-right: 60px;font-size:14px" class="select-list ">
                                        <li class="col-sm-4" style="margin-bottom: 20px">
                                          楼栋：[[${room.floornum}]]号楼
                                        </li>
                                        <li class="col-sm-3" style="margin-bottom: 20px">
                                            单元：[[${room.unitnum}]]单元
                                        </li>
                                        <li class="col-sm-3" style="margin-bottom: 20px">
                                            编号：[[${room.roomNum}]]
                                        </li>
                                        <li class="col-sm-4" style="margin-bottom: 20px">
                                            房屋ID：[[${room.roomId}]]
                                        </li>
                                        <li class="col-sm-3" style="margin-bottom: 20px">
                                            楼层数：[[${room.layer}]]
                                        </li>
                                        <li class="col-sm-3" style="margin-bottom: 20px">
                                            户型：[[${room.apartment}]]
                                        </li>
                                        <li class="col-sm-4" style="margin-bottom: 20px">
                                            面积：[[${room.builtUpArea}]]
                                        </li>
                                        <li class="col-sm-3" style="margin-bottom: 20px">
                                            备注：[[${room.remark}]]
                                        </li>
                            </div>
                                <button type="button" th:onchange="'roomrelieve('+${room.roomId}+')'" style="position: relative;top: 100px" class="btn btn-success">解除绑定</button>
                            </div>

                        </div>
            </div>
        </div>
    </div>

            <div class="row" th:each="carLot : ${carLotList}">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>[[${carLot.carLotNum}]]车位信息</h5>
                        </div>
                        <div class="ibox-content">
                            <div class="media">
                            <div style="margin-right: 60px;font-size:14px" class="select-list">
                                <li class="col-md-3" style="margin-bottom: 20px">
                                    车位ID：[[${carLot.carLotNum}]]
                                </li>
                                <li class="col-md-3" style="margin-bottom: 20px">
                                    停车场id：
                                </li>
                                <li class="col-md-3" style="margin-bottom: 20px">
                                    车位编号：
                                </li>
                                <li class="col-md-3" style="margin-bottom: 20px">
                                    车位状态：
                                </li>
                                <li class="col-md-3" style="margin-bottom: 20px">
                                   面积：
                                </li>
                                <li class="col-md-3" style="margin-bottom: 20px">
                                   备注：
                                </li>
                            </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    function  checkinroom(id) {
        var index = layer.open({
            type: 2,
            area: [900+ 'px', ($(window).height() -20) + 'px'],
            fix: false,
            //不固定
            maxmin: true,
            shade: 0.3,
            title: "入住房屋",
            content: "/owner/rel/checkInRoom/"+id,
            btn: ['确定', '关闭'],
            // 弹层外区域关闭
            shadeClose: true,
            yes: doSubmit,
            cancel: function(index) {
                return true;
            },
            callBack: callBack
        });
    }
    function doSubmit(index, layero) {
        var body = layer.getChildFrame('body', index);
        layer.close(index);
    }
    function callBack() {
        layer.msg("添加成功", {icon: 1});
        setTimeout(function () {
            location.reload();
        },1500)
    }
    function  roomrelieve(id) {
            var ass=id;
            var ownerId=$("#ownerId").val();
        $.ajax({url:"/owner/rel/detail",type:"get",data:"ownerId="+$("#ownerId").val()+"&assetsType="+$("#assetsType").val()+"&detailsId="+$("#detailsId").val(),async:true,success:function () {
                console.log("11")
            },error:function () {
                layer.msg("操作失败", {icon: 2});
            },complete:function () {
            }
        });
    }

</script>
</body>
</html>
